<div class="hbox hbox-auto-xs hbox-auto-sm" ng-init="
    app.settings.asideFolded = false;
    app.settings.asideDock = false;
  ">
    <!-- main -->
    <div class="col">
        <!-- main header -->
        <div class="bg-light lter b-b wrapper-md">
            <div class="row">
                <div class="col-sm-6 col-xs-12">
                    <h1 class="m-n font-thin h3 text-black">阿里云MQ</h1>
                    <small class="text-muted">配置管理</small>
                </div>
            </div>
        </div>
        <!-- / main header -->
        <div class="wrapper-md">
            <!-- toaster directive -->
            <toaster-container
                    toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
            <!-- / toaster directive -->

            <uib-tabset>
                <uib-tab index="0" heading="消费者状态查询">
                    <div class="panel panel-default" ng-controller="aliyunMqStatusCtrl">
                        <div class="panel-body">

                            <form class="form-inline" role="form">
                                <div class="form-group">
                                    <div class="input-group">
                                        <span class="input-group-addon">消费者名称(GID)</span>
                                        <input type="text" class="form-control"
                                               style="min-width: 400px;max-width: 400px;" ng-model="consumerQueryName"
                                               placeholder="CID名称">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <button type="button" class="btn btn-info" ng-click="queryConsumer()"><span
                                            class="glyphicon glyphicon-search"></span>搜索
                                    </button>
                                    <!--<button type="button" class="btn btn-info" ng-click="reSet()"><span-->
                                    <!--class="glyphicon glyphicon-repeat"></span>重置-->
                                    <!--</button>-->
                                </div>
                            </form>

                            <h4 class="modal-title" style="margin-top: 15px;"><b class="fa fa-bars"
                                                                                 style="color: #286090">消费者状态信息</b></h4>
                            <div style="box-shadow: 0 0 5px #ddd;padding: 10px">
                                <table class="table table-hover table-bordered table-striped" ng-show="consumer.cid != ''">
                                    <thead>
                                    <tr>
                                        <td>条目</td>
                                        <td>值</td>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr>
                                        <td>
                                            <b style="color: #286090">GID:</b>
                                        </td>
                                        <td>{{consumer.cid}}
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <b style="color: #286090">是否在线:</b>
                                        </td>
                                        <td>
                                            <b style="color: #20a03f" ng-show="consumer.online">是</b>
                                            <b style="color: #ef2929" ng-show="!consumer.online">否</b>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <b style="color: #286090">订阅关系是否一致:</b>
                                        </td>
                                        <td>
                                            <b style="color: #20a03f" ng-show="consumer.subscriptionSame">是</b>
                                            <b style="color: #ef2929" ng-show="!consumer.subscriptionSame">否</b>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <b style="color: #286090">消费模式:</b>
                                        </td>
                                        <td>
                                            {{consumer.consumeModel}}
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <b style="color: #286090">消费TPS:</b>
                                        </td>
                                        <td>
                                            {{consumer.consumeTps}}条/秒
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <b style="color: #286090">堆积量:</b>
                                        </td>
                                        <td>
                                            {{consumer.totalDiff}}条
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <b style="color: #286090">最近消费时间:</b>
                                        </td>
                                        <td>
                                            {{consumer.gmtLastTime}}
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <b style="color: #286090">消费延迟时间:</b>
                                        </td>
                                        <td>
                                            {{consumer.delayTime}}ms
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>

                            <h4 class="modal-title" style="margin-top: 15px;"><b class="fa fa-chain"
                                                                                 style="color: #286090">连接状态</b></h4>
                            <div class="panel panel-default" style="margin-top: 5px;">
                                <div class="panel-body">
                                    <div>
                                        <table class="table table-hover table-bordered table-striped">
                                            <thead>
                                            <tr>
                                                <td>客户端ID</td>
                                                <td>客户端IP</td>
                                                <td>语言</td>
                                                <td>版本</td>
                                                <td>操作</td>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <tr ng-repeat="connection in consumer.connectionSet">
                                                <td>
                                                    <b style="color: #286090">{{connection.clientId}}</b>
                                                </td>
                                                <td>
                                                    {{connection.clientAddr}}
                                                </td>
                                                <td>
                                                    {{connection.language}}
                                                </td>
                                                <td>{{connection.version}}</td>
                                                <td ng-if="contains(authPoint, '/server/save')">
                                                    <button ng-click="editServer(item)"
                                                            class="btn btn-xs"
                                                            style="margin-left: 5px; background-color: #2e6da4; color: white;">
                                                        <span class="glyphicon glyphicon-edit"></span>编辑
                                                    </button>

                                                    <button ng-click="delServer(item)"
                                                            class="btn btn-xs pull-right"
                                                            style="background-color: red; color: white;">
                                                        <span class="glyphicon glyphicon-remove"></span>删除
                                                    </button>

                                                </td>
                                            </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </uib-tab>
            </uib-tabset>
        </div>
    </div>
    <!-- / main -->
</div>

<!--新建Topic-->
<script type="text/ng-template" id="createTopicModal">
    <div ng-include="'tpl/modal/mq/create_topic_modal.html'"></div>
</script>

<!--新建Subscribe-->
<script type="text/ng-template" id="createSubscribeModal">
    <div ng-include="'tpl/modal/mq/create_subscribe_modal.html'"></div>
</script>